var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, e, n, o) {
    var a, r = arguments.length, i = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, n) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, n, o); else for (var c = t.length - 1; 0 <= c; c--) (a = t[c]) && (i = (r < 3 ? a(i) : 3 < r ? a(e, n, i) : a(e, n)) || i);
    return 3 < r && i && Object.defineProperty(e, n, i), i;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("PopItemView"), s = e("Global"), c = e("GameManager"), l = e("TimeView"), d = e("PetManager"), u = e("PersonView"), p = e("GameData"), h = e("AdManager"), f = e("UIManager"), g = cc._decorator, m = g.ccclass, y = g.property, v = function(n) {
    function t() {
        var t = null !== n && n.apply(this, arguments) || this;
        return t.time = null, t.pet = null, t;
    }
    return i(t, n), t.prototype.onEnable = function() {
        n.prototype.onEnable.call(this), this.pet.initPet();
    }, t.prototype.onClickBack = function() {
        p.GD.emptyFailCount++, n.prototype.onClickBack.call(this);
    }, t.prototype.closePnl = function() {
        this.hidePnl(), h.default.getInstance().hideAllBanner(), c.default.getInstance().matchType == c.MatchType.三对三 ? c.default.getInstance().battleGame() : c.default.getInstance().matchGame();
    }, t.prototype.start = function() {
        var t = this;
        n.prototype.start.call(this);
        var e = d.default.getInstance().load(Date.now());
        0 < e && (this.time.node.active = !0, this.time.init(e), this.time.startTimer(), 
        this.time.node.on("finished", function() {
            t.time.node.off("finished"), t.callback();
        }, this));
    }, t.prototype.callback = function() {
        s.G.chargeList[p.GD.petDataIdx] = 0, d.default.getInstance().getRealData().hp = d.default.getInstance().getHp(p.GD.petDataIdx), 
        f.default.getInstance().petShows.forEach(function(t) {
            return t.refresh();
        }), this.closePnl();
    }, a([ y(l.default) ], t.prototype, "time", void 0), a([ y(u.default) ], t.prototype, "pet", void 0), 
    a([ m ], t);
}(r.default);

n.default = v;